import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_huawei_account/flutter_huawei_account.dart';
import 'package:flutter_huawei_account/flutter_huawei_account_platform_interface.dart';
import 'package:flutter_huawei_account/flutter_huawei_account_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterHuaweiAccountPlatform
    with MockPlatformInterfaceMixin
    implements FlutterHuaweiAccountPlatform {
  
  @override
  Future<String?> code() {
    // TODO: implement code
    throw UnimplementedError();
  }

  @override
  PlatformViewFactory? createLoginButtonFactory() {
    // 返回null用于测试
    return null;
  }
}

void main() {
  final FlutterHuaweiAccountPlatform initialPlatform = FlutterHuaweiAccountPlatform.instance;

  test('$MethodChannelFlutterHuaweiAccount is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterHuaweiAccount>());
  });

  test('getPlatformVersion', () async {
    FlutterHuaweiAccount flutterHuaweiAccountPlugin = FlutterHuaweiAccount();
    MockFlutterHuaweiAccountPlatform fakePlatform = MockFlutterHuaweiAccountPlatform();
    FlutterHuaweiAccountPlatform.instance = fakePlatform;
  });
}